package com.yict.csms.timer;

import javax.annotation.Resource;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.yict.csms.resourceplan.service.IShipPlanService;

public class ShipmentCostJob extends QuartzJobBean {
	private static Log logger = LogFactory.getLog(ShipmentCostJob.class);
	private IShipPlanService shipPlanService;

	@Override
	protected void executeInternal(JobExecutionContext context)
			throws JobExecutionException {
		try {
			shipPlanService.createCost();
		} catch (Exception e) {
			logger.error("船舶箱量操作计费出错：" + e.getMessage());
		}
	}

	public IShipPlanService getShipPlanService() {
		return shipPlanService;
	}

	@Resource(name = "shipPlanService")
	public void setShipPlanService(IShipPlanService shipPlanService) {
		this.shipPlanService = shipPlanService;
	}
}
